package cn.jy.generate.constant;

/**
 * DB常用sql.
 *
 * @author ljw
 */
public class DbConstant {

	/** 获取表信息 */
	public static final String getTableInfoSql = """
						SELECT TABLE_SCHEMA, TABLE_COMMENT \s
						FROM \s
							INFORMATION_SCHEMA.TABLES \s
						WHERE TABLE_NAME = '%s' AND TABLE_SCHEMA = '%s'
					""";

	/** 获取列信息 */
	public static final String getTableColumnSql = """
						SELECT \s
							COLUMN_NAME, ORDINAL_POSITION, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE, COLUMN_COMMENT \s
						FROM INFORMATION_SCHEMA.COLUMNS \s
						WHERE TABLE_NAME = '%s' AND TABLE_SCHEMA = '%s'
					""";

	/** 获取字典 */
	public static final String getDictSql = """
						SELECT * FROM `%s`.`%s` where `code` = '%s';
					""";

}
